﻿@model HomeCareLibrary.Models.PromoCodeModel
<div class="col-lg-9 col-sm-9 right_part">
            <div class="promoCode-page">
              <div class="main-content">
                <div class="personalization-content no-padding">
                  <div class="personalization-bg">
                    <div class="personalization-inn">
                      <div class="personalization-data promo-per-data" > <br />
                        <h3 class="personalization-heading">Promo Code</h3>
                        <input type="hidden" id="sponsorStatus" />
                            @if (Session[HomeCareLibrary.Constants.SessionConstants.MODE] == null)
                                                    {
                                     
                                     }
                            else if (Session[HomeCareLibrary.Constants.SessionConstants.MODE].ToString() == "iphoneApp" || Session[HomeCareLibrary.Constants.SessionConstants.MODE].ToString() == "androidApp")
                                    
                                     {

                                         using (Ajax.BeginForm("UpdatePromoCode", "Personalization", new AjaxOptions
                                                    {
                                                        HttpMethod = "POST",
                                                        LoadingElementId = "wait",
                                                        OnSuccess = "success",



                                                    }, new { id = "FormWebView" }))
                                                   {
                              
                                           @Html.HiddenFor(m => m.user_id)
                                @Html.HiddenFor(m => m.ChangePromocode)
                                @Html.HiddenFor(m => m.DeletePromocode)
                          
                                       <p class="top-data">You can add or change your<br>
                                      Promo Code here </p>
                        
                                    <div class="Dwelling-part login-form">
                                      <div class="form-per">
                                        <form role="form">
                                        <div class="update text-center" id="update" style="display:none;">
                                                        <label class="red">
                                                          updated </label>
                                                      </div>

                                             <div class="update text-center" id="delete" style="display:none;">
                                                        <label class="red">
                                                          deleted </label>
                                                      </div>
                                          <div class="form-group" style="position: relative;">
                                            <label for="promoCode">Promo Code</label>
                            
                                                                @Html.TextBoxFor(m => m.sponsor, new {@class = "form-control" })
                                               @Html.Hidden("hdnDeletePromoCode", @Url.Action("DeletePromoCode", "Personalization"))
                                                @Html.Hidden("hdnUserID", @Model.user_id)
                                              <a class="delete" href="javascript:void(0);" id="btnDeletePromo">Delete</a>
                                          </div>
                             
                             
                                            <br />
                                          <div class="button">
                                          <a  id="btnPromoCode"  style="cursor:pointer;" class="btn-per">Submit</a>
                                
                                          </div>
                                        </form>
                                      </div>
                                    </div>
                                        }
                            }
                      </div>
                    </div>
                  </div>
                </div>
              </div>
            </div>
     <div id="wait" style="display:none;width:100%;z-index: 999;height:100%;position:absolute;top:0; bottom:0;left:0; right:0;padding:2px;background-color: rgba(0, 0, 0, 0.4);">
                    <div style="width: 86px; margin: 27% auto 0px;"><img style="" src='@Url.Content("~/images/demo_wait.gif")'  /><br>Loading..</div></div>

   
          </div>
@section script {
@*<script src="@Url.Content("~/Scripts/jquery.unobtrusive-ajax.min.js")" type="text/javascript"></script>
 <script src="@Url.Content("~/js/webview/adminpromocode.js")" type="text/javascript"></script>*@

      @Scripts.Render("~/Scripts/BundledScriptsAdminPromoCode")

   }
